feat: implement terminal style chat history#1778
feat: implement terminal style chat history#1778PratyushChauhan wants to merge 13 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Video: 2026-04-06.14-55-36.mp4 |
- Clear navigation history when resetting the local composer state - Drop any saved draft so a new thread starts clean
- Unify ArrowUp/ArrowDown prompt history handling in ChatView - Preserve draft restoration when leaving history mode
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (arrow key navigation through chat history) that changes how users interact with the chat composer. While self-contained and straightforward, new interaction patterns warrant human review to ensure the UX meets expectations. You can customize Macroscope's approvability policy. Learn more. |
- Clear prompt history state when sending a plan or slash command - Prevent stale draft restoration after submission
- Recompute the composer trigger after loading the next draft - Keeps autocomplete state in sync with the restored prompt
- Use double quotes consistently in ChatView draft/history state - Keep prompt history navigation behavior unchanged
- Skip ArrowUp/ArrowDown message history navigation while progress is pending - Prevents input state from being interrupted by active agent updates
- Restore the collapsed composer cursor after draft recall - Recompute trigger state from the adjusted cursor position
- Ignore ArrowUp/ArrowDown history navigation while progress is pending - Preserve existing history traversal once the pending state clears
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7d90559. Configure here.
- Keep the expanded cursor position separate from the collapsed composer cursor - Detect composer triggers from the full draft text instead of the collapsed cursor
- Recompute the cursor and trigger from the restored text length - Keep the prompt ref in sync before updating composer state
|
addressed potential issues. |

closes #1777
What Changed
Pressing
↑/↓in the composer input navigates through previously sent user messages, shell-style. The live draft is saved when you first press↑and restored when you↓back past the most recent message. History index resets on send.Why
Retyping or slightly tweaking a previous prompt is a common workflow. Every terminal does this — it's muscle memory. The composer already had the full message history available; this just wires
↑/↓intoonComposerCommandKey(where Enter/Tab/menu-navigation already live) using two refs. No new files, no new state, no re-renders.UI Changes
No visual changes — interaction only. Navigation only activates when no autocomplete menu is open, so
@-mention and/-command menus are unaffected.Checklist
Note
Low Risk
Low risk UI-only keyboard handling change in
ChatViewthat reads prior user messages; main risk is minor UX edge cases around history bounds and pending-input states.Overview
Adds terminal-style history navigation to the chat composer. Pressing
ArrowUpcycles backward through previously sent user messages andArrowDownmoves forward, restoring the saved live draft when returning to index-1.History state is kept in refs (
historyIndexRef,savedDraftRef) and is reset whenever the composer is cleared (thread reset, normal send, plan follow-up submit, or standalone slash-command handling), and navigation is disabled while pending user-input progress is active.Reviewed by Cursor Bugbot for commit 0ed3e22. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add terminal-style chat history navigation to the composer with ArrowUp/ArrowDown
activePendingProgressis truthy.Macroscope summarized 0ed3e22.